package main

import (
	"gin/cors"
	"gin/models"
	"gin/routers"

	"github.com/gin-gonic/gin"
)

func main() {
	//初始化数据库
	models.InitDb()

	//注册路由
	r := gin.Default()
	r.Use(middleware.Cors())
	routers.InitRouter(r)
	r.Run(":8081") // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}
